<?php 
require_once('inc/conn.php');
   if($_POST['title']==""){
    echo "<script>alert('标题不能为空');history.go(-1)</script>";
    exit;
   } 
   if($_POST['lianjie']==""){
    echo "<script>alert('链接不能为空');</script>";
    exit;
   }
   if($_POST['tupian']==""){
    echo "<script>alert('图片不能为空');</script>";
    exit;
   }
   $sql="INSERT INTO slide(title,lianjie,tupian)VALUES('".$_POST['title']."','".$_POST['lianjie']."','".$_POST['tupian']."')";
   mysql_query($sql);
   echo "<script>alert('添加成功!');window.location.href='slide_add.php'</script>";
   mysql_close($conn);

 ?>